package com.gitee.huxing.courese.core;

import java.util.Collection;
import java.util.Queue;
import java.util.concurrent.TimeUnit;

/**
 * @Description: 自定义一个消息队列
 * @ProjectName: JavaCourse
 * @Package: com.gitee.huxing.courese.core
 * @ClassName: MessageQueue
 * @Author: huxing
 * @DateTime: 2021-11-07 5:24 下午
 */
public interface MessageQueue<E> extends Collection<E> {

    /**
     * @Description: 添加一条记录
     * @Author: huxing
     * @param e
     * @return boolean
     * @Date: 2021/11/7 5:30 下午
     **/
    boolean add(E e);

    /**
     * @Description: 偏移写入一条记录
     * @Author: huxing
     * @param e
     * @return boolean
     * @Date: 2021/11/7 5:30 下午
     **/
    boolean offer(E e);

    /**
     * @Description: 移除一条记录
     * @Author: huxing
     * @param
     * @return E
     * @Date: 2021/11/7 5:31 下午
     **/
    E remove();

    /**
     * @Description:
     * @Author: huxing
     * @param
     * @return E
     * @Date: 2021/11/7 5:31 下午
     **/
    E poll(Integer consumerId);

}
